<%@ page import="java.util.*" language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>标签管理系统 - 首页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- basic styles -->
    <link href="${basePath}/ACE/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="${basePath}/ACE/css/font-awesome.min.css" />
    <!--[if IE 7]>
		  <link rel="stylesheet" href="${basePath}/ACE/css/font-awesome-ie7.min.css" />
		<![endif]-->
    <!-- page specific plugin styles -->
    <!-- fonts -->
    <!-- ace styles -->
    <link rel="stylesheet" href="${basePath}/ACE/css/ace.min.css" />
    <link rel="stylesheet" href="${basePath}/ACE/css/ace-rtl.min.css" />
    <link rel="stylesheet" href="${basePath}/ACE/css/ace-skins.min.css" />
    <!--[if lte IE 8]>
		  <link rel="stylesheet" href="${basePath}/ACE/css/ace-ie.min.css" />
		<![endif]-->
    <!-- inline styles related to this page -->
    <!-- ace settings handler -->
    <script src="${basePath}/ACE/js/ace-extra.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
		<script src="${basePath}/ACE/js/html5shiv.js"></script>
		<script src="${basePath}/ACE/js/respond.min.js"></script>
		<![endif]-->
</head>
<body>
    <div class="main-container" id="main-container">
        <div class="main-container-inner">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="welcome.htm" >首页</a> </li>
                    <li><a href="#">读者管理</a> </li>
                    <li class="active">读者信息列表</li>
                </ul>
                <!-- .breadcrumb -->
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="col-xs-12">
                            <!-- PAGE CONTENT BEGINS -->
                            <form method="post" action="">
                            <div>
                                <input type="text" placeholder="用户名"  name="uname" class="width-20" value="${param.uname }"/>
                                <input type="text" placeholder="押金"   name="deposite" class="width-20" value="${param.deposite }" />
                                <input type="text" placeholder="地址"   name="address"  class="width-20" value="${param.address }"/>
                                <input type="radio" name="sex" id=""  value="male" />男
                                <input type="radio" name="sex" id=""  value="female"/>女
                                <input type="hidden" name="pageIndex" value="${page.pageIndex }" />
                                <input type="submit" value="检索" class="btn btn-primary btn-sm" />
                            </div>
                            </form>
                            <div class="hr-12"></div>
                            <div>
                                <table class="table table-hover table-bordered">
                                    <thead>
                                        <tr>
                                            <th><input type="checkbox" name="" id="" />序号</th>
                                            <th>用户名</th> 
                                            <th>性别</th>                                           
                                            <th>出生日期</th>
                                            <th>地址</th>
                                            <th>押金</th>
                                            <th>是否冻结</th>
                                            <th>操作列</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${page.data }" var="reader" varStatus="status">
                                        <tr>
                                            <th><input type="checkbox" name="" id="" />${status.count+(page.pageIndex-1)*page.pageSize }</th>
                                            <td><a href="#">${reader.uname }</a></td>
                                            <td>${reader.sex }</td>
                                            <td>${reader.birthday }</td>
                                            <td>${reader.address }</td>
                                            <td>${reader.deposite }</td>
                                            <td>${reader.locked==0?"冻结":"正常"}</td>
                                            <td>
                                                <a href="${basePath }/reader/update.do?id=${reader.uid }"><i class="icon-edit"></i>修改</a>&nbsp;&nbsp;
                                                <a href="${basePath }/reader/delete.do?id=${reader.uid }" onclick="return confirm('确认删除用户')"><i class="icon-remove"></i>删除</a>&nbsp;&nbsp;
                                                <a href="#"><i class="icon-info"></i>重置密码</a>&nbsp;&nbsp;
                                                <c:if test="${reader.locked==1 }">
                                                <a href="#"><i class="icon-remove"></i>冻结用户</a>
                                                </c:if>
                                                <c:if test="${reader.locked==0 }">
                                                <a href="#"><i class="icon-remove"></i>解冻用户</a>
                                                </c:if>
                                            </td>
                                        </tr>
                                     </c:forEach>                                        
                                    </tbody>
                                </table>                                
                                <div class="page">
                                	<a href="" class="btn" data="1">首页</a>
                                	<a href="" class="btn" data="${page.pageIndex-1<1?1:page.pageIndex-1 }">上一页</a>
                                	<a href="" class="btn" data="${page.pageIndex+1>page.totalPage?page.totalPage:page.pageIndex+1}">下一页</a>
                                	<a href="" class="btn" data="${page.totalPage }">尾页</a>
                                </div>
                            </div>
                            <!-- PAGE CONTENT ENDS -->
                        </div>
                        <!-- /.col -->
                    </div>
                    <!-- /.row -->
                </div>
                <!-- /.page-content -->
            </div>
            <!-- /.main-container-inner -->
            <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"><i class="icon-double-angle-up icon-only bigger-110">
            </i></a>
        </div>
        <!-- /.main-container -->
        <script src='${basePath}/ACE/js/jquery-2.0.3.min.js' type="text/javascript"></script>
        <script type="text/javascript">
            if ("ontouchend" in document) document.write("<script src='${basePath}/ACE/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
        </script>
        <script src="${basePath}/ACE/js/bootstrap.min.js" type="text/javascript"></script>
        <script src="${basePath}/ACE/js/typeahead-bs2.min.js" type="text/javascript"></script>
        <script src="${basePath}/ACE/js/ace-elements.min.js" type="text/javascript"></script>
        <script src="${basePath}/ACE/js/ace.min.js" type="text/javascript"></script>
        <script type="text/javascript">
        $(function(){
     	   $(".page>a").click(function(event){
     		   event.preventDefault();        		   
     		   var page=$(this).attr("data");        		   
     		   $("input[name='pageIndex']").val(page);
     		   $("form").submit();        		   
     	   });
     	   
     	   //提交表单 
     	   $("input:submit").click(function(event){
     		   event.preventDefault();  
     		   $("input[name='pageIndex']").val(1);
     		   $("form").submit();           		   
     	   });
     	   
     	   
     	   
        });
        </script>
</body>
</html>
